<?php
class model_user extends doom_core_model {
	
    protected $tablePrefix = 'user_';
    
    public function getDbConfig() {
        return config_sns::$DB_BASE[1];
    }
    
    public function getTableId() {
        return 1;
    }
	
	
	public function getByUserId($userId) {
	    $sql = <<<SQL
SELECT userid,nickname,sex FROM {$this->table} WHERE userid={$userId};
SQL;
	    $rs = $this->db->query($sql);
	    
	    if ($rs === FALSE) {
	        $this->error->set($this->db->error);
	        return FALSE;
	    }
	    
        return $rs;
	}
}
